package com.tedu.springmybatis;

import com.tedu.mapper.SmbmsUserMapper;
import com.tedu.pojo.SmbmsUserExample;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringMybatis {

    @Test
    public void getAllUser(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        SmbmsUserMapper bean = applicationContext.getBean(SmbmsUserMapper.class);
        System.out.println(bean.selectByExample(new SmbmsUserExample()));
    }
 
    @Test
    public void InsetUser() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        SmbmsUserMapper bean = applicationContext.getBean(SmbmsUserMapper.class);


        System.out.println(bean.selectByExample(new SmbmsUserExample()));
    }
}
